import { useState } from 'react';
import { CSSTransition } from 'react-transition-group';
const Transition = () => {
  const [isShow, setShow] = useState<boolean>(true);
  return (
    <>
      <CSSTransition in={isShow} classNames={'box'} timeout={3000}>
        <div />
      </CSSTransition>
      <button
        onClick={() => {
          setShow(true);
        }}
      >
        显示
      </button>
      <button
        onClick={() => {
          setShow(false);
        }}
      >
        隐藏
      </button>
    </>
  );
};
export default Transition;
